package staff.logic;

import java.util.ArrayList;
import java.util.List;

import staff.logic.Employee.PositionType;

public class Manager extends Position {

    public Manager(Employee employe) {
        super(employe);
        description = "";
    }

    @Override
    public List<Employee> getSubordinate(EmployeSystem employeSystem) {
        List<Employee> result = new ArrayList<Employee>();
        for (Employee current : employeSystem) {
            if (current.getManagerId() == employe.getEmployeId()) {
                result.add(current);
            }
        }
        return result;
    }

    @Override
    public PositionType getType() {
        return PositionType.MANAGER;
    }

    @Override
    public String getDescription() {
        return description;
    }

    @Override
    public void setDescription(String description) {
        throw new UnsupportedOperationException("Description for manager cannot be changed");
    }

}
